//
//  CommonValuesHeader.h
//  FWeChat
//
//  Created by iSolar on 2017/10/24.
//  Copyright © 2017年 NOOrganization. All rights reserved.
//

#ifndef CommonValuesHeader_h
#define CommonValuesHeader_h

#define kWidth [UIScreen mainScreen].bounds.size.width
#define kHeight [UIScreen mainScreen].bounds.size.height

/***********  适配iPhone X  ************/
#define IPhoneX       (kWidth == 375.f && kHeight == 812.f)

/***********  SafeArea  ************/
#define kTopMargin    (IPhoneX ? 44.f : 20.f)
#define KBottomMargin (IPhoneX ? 34.f : 0.f)

/***********  导航栏和TabBar  ************/
#define kMaxNaviH     (IPhoneX ? 84.f : 64.f)
#define kViewFrameY   (kTopMargin + 44.f)
#define kTabBarH      49.f
#define kStatusH      (IPhoneX ? 44.f : 20.f)

#define WS(weakSelf)      __weak __typeof(&*self)weakSelf = self;

#define SS(strongSelf)    __strong typeof(&*self) strongSelf = weakSelf;

#define W(obj)   (!obj?0:(obj).frame.size.width)
#define H(obj)   (!obj?0:(obj).frame.size.height)
#define X(obj)   (!obj?0:(obj).frame.origin.x)
#define Y(obj)   (!obj?0:(obj).frame.origin.y)
#define XW(obj) (X(obj)+W(obj))
#define YH(obj) (Y(obj)+H(obj))
#define BoldFont(x) [UIFont boldSystemFontOfSize:x]
#define Font(x) [UIFont systemFontOfSize:x]

#define marginW 10.0f

#define kImageNamed(x) [UIImage imageNamed:@"x"]


#endif /* CommonValuesHeader_h */
